import request from '@/utils/request'

// 查询车位租赁列表
export function listPakingRent(query) {
  return request({
    url: '/zlgl/pakingRent/list',
    method: 'get',
    params: query
  })
}
//查询所有小区信息
export function queryCommunityList1(){
  return request({
    url:'/basic/community/list',
    method:'get',
  })
}
//根据小区id查询旗下的区域
export function queryRegion1(id){
  return request({
    url:'/parking/region/list',
    method:'get',
     params:{communityId:id}
  })
}
//根据小区id查询旗下所有的车位总数和租用中车位总数
export function queryParkingAndRentParkingTotal(id){
  return request({
    url:'/parking/carLocation/selectParkingAndRentParkingTotal/'+id,
    method:'get'
  })
}
//根据区域id查询旗下的区域
export function queryParkNum(id){
return request({
  url:'/parking/carLocation/listAll',
  method:'get',
  params:{regionId:id}
})
}
// 根据起始时间和结束时间查询金额0
export function queryTotal(time) {
  return request({
    url: '/parking/carLocation/queryTotal',
    method: 'post', // 或者 'put'，取决于后端接口的要求
    data: time // 将对象作为请求体发送
  })
}
export function queryBalconyunithomeId(){
  return request({
    url:'/zlgl/pakingRent/selectRoom',
    method:'get'
  })
}
//根据costid查询cost
export function queryCostByCostId(id){
  return request({
    url:'/parking/carLocation/queryCost/'+id,
  method:'get'
  })
}
// 查询车位租赁详细
export function getPakingRent(id) {
  return request({
    url: '/zlgl/pakingRent/' + id,
    method: 'get',
   
  })
}
//根据车位位置查询租赁信息
export function selectWyParkingRentByParkId(id){
  return request({
    url:'/zlgl/pakingRent/selectByParkId',
    method:'get',
    params:{
      parkId:id
    }
  })
}

// 新增车位租赁
export function addPakingRent(data) {
  return request({
    url: '/zlgl/pakingRent',
    method: 'post',
    data: data
  })
}

// 修改车位租赁
export function updatePakingRent(data) {
  return request({
    url: '/zlgl/pakingRent',
    method: 'put',
    data: data
  })
}

// 删除车位租赁
export function delPakingRent(id) {
  return request({
    url: '/zlgl/pakingRent/' + id,
    method: 'delete'
  })
}
